package com.netease.config;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @projectName: modeling-dev
 * @package: com.netease.config
 * @className: FlyBookConfig
 * @author: aochong
 * @description: 读取飞书配置
 * @date: 2023/4/24 15:42
 * @version: 1.0
 */
@Configuration //表明这是一个配置类
//该注解用于绑定属性。prefix用来选择属性的前缀，也就是在flybook.properties文件中的“fs”，ignoreUnknownFields是用来告诉SpringBoot在有属性不能匹配到声明的域时抛出异常。
@ConfigurationProperties(prefix = "fs",ignoreInvalidFields = false)
//指定配置文件路径
@PropertySource(value = "classpath:config/flybook.properties",ignoreResourceNotFound = false)
//标识为Bean
@Component
//lombok注解，用于生成getter&setter方法
@Data
@AllArgsConstructor
@NoArgsConstructor
public class FlyBookConfig {

    /**
     * 飞书APP ID
     */
    private String app_id;

    /**
     * 飞书APP秘钥
     */
    private String app_secret;

    /**
     * 飞书webhook
     */
    private String webhook1;

}
